<?php
/**
 *
 * @author RUMEAU
 * @version 
 */
require_once 'Zend/Loader/PluginLoader.php';
require_once 'Zend/Controller/Action/Helper/Abstract.php';

/**
 * TriggerError Action Helper 
 * 
 * @uses actionHelper Bcmsx_Controller_Action_Helper
 */
class Bcmsx_Action_Helper_TriggerError extends Zend_Controller_Action_Helper_Abstract
{
	/**
	 * @var Zend_Loader_PluginLoader
	 */
	public $pluginLoader;
	
	/**
	 * Constructor: initialize plugin loader
	 * 
	 * @return void
	 */
	public function __construct()
	{
		// TODO Auto-generated Constructor
		$this->pluginLoader = new Zend_Loader_PluginLoader ( );
	}
	
	/**
	 * Strategy pattern: call helper as broker method
	 */
	public function direct( $msg = null )
	{
		$this->view->message = $msg;

		$this->_actionController->getHelper('redirector')->gotoSimpleAndExit( 'custom-error', 'error', 'default' );
	}
}

